package gui;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.geom.Point2D;
import java.util.List;

/**
 * 
 * @author rwb10
 *
 */
@SuppressWarnings("serial")
public class ScatterPlot extends Axis {

    private static final int OVAL_SIZE = 5;

    /**
     * @param size Size
     */
    public ScatterPlot (Dimension size) {
        super(size);
    }

    @Override
    void paintTicMarks (Graphics pen) {
    }

    @Override
    void paintData (Graphics pen) {
        List<Point2D> data = normalizeData();
        for (Point2D point : data) {
            paintDataPoint(pen, point);
        }
    }

    private void paintDataPoint (Graphics pen, Point2D point) {
        pen.setColor(Color.BLACK);
        pen.fillOval((int)point.getX(), (int) point.getY(), OVAL_SIZE, OVAL_SIZE);
    }
    /**
     * @param myTitle the myTitle to set
     */
    public void setMyTitle (String myTitle) {
        super.setMyTitle("Scatter Plot of " + myTitle);
    }

}

